﻿﻿@model WebApp.Models.MenuItem
<!-- 弹出窗体form表单 -->
<div id="detailswindow" class="easyui-window"
     title="明细数据"
     data-options="modal:true,
                    closed:true,
                    iconcls:'icon-save',
                    footer:'#windowfooter',
                    onOpen:function(){
                       $(this).window('vcenter');
                    },
                    onRestore:function(){
                      $menuitemsdg.datagrid('resize');
                    },
                    onMaximize:function(){
                      $menuitemsdg.datagrid('resize');
                    }
                    " style="width:840px;height:420px;display:none">
  <!-- begin toolbar -->
  <div class="panel-content py-2 rounded-bottom border-faded border-left-0 border-right-0  text-muted">
    <div class="row m-0">
      <div class="col-sm-8">
        <div class="btn-group btn-group-sm">
          <button name="saveitembutton" onclick="saveitem()" class="btn btn-default">
            <i class="fa fa-floppy-o"></i> @Html.L("Save")
          </button>
        </div>
        <div class="btn-group btn-group-sm" id="deleteitem-btn-group">
          <button onclick="deleteitem()" class="btn btn-danger">
            <i class="fa fa-trash-o"></i> @Html.L("Delete")
          </button>
        </div>
        <div class="btn-group btn-group-sm" style="display:none">
          <button onclick="todo()" class="btn btn-default">
            <i class="fa fa-print"></i> ToDo
          </button>
        </div>
      </div>
      <div class="col-sm-4 text-align-right">

      </div>
    </div>
  </div>
  <div class="panel-container show">
  <div class="panel-content">
    <form id="menuitem_form"
          class="easyui-form form-horizontal p-1"
          method="post"
          data-options="novalidate:true,
                            onChange: function(target){
                              hook = true;
                              $('button[name*=\'saveitembutton\']').prop('disabled', false);
                             },
                             onLoadSuccess:function(data){
                               hook = false;
                               $('button[name*=\'saveitembutton\']').prop('disabled', true);
                             }">
      @Html.AntiForgeryToken()
      <!--Primary Key-->
      @Html.HiddenFor(model => model.Id)
      <fieldset class="form-group">
        <div class="row m-1">
          <label class="col-md-2 form-label text-right text-danger">@Html.DisplayNameFor(model => model.Title)</label>
          <div class="col-md-4 mb-1">
            <input id="@Html.IdFor(model => model.Title)"
                   name="@Html.NameFor(model => model.Title)"
                   value="@Html.ValueFor(model => model.Title)"
                   tabindex="0" required
                   class="easyui-textbox"
                   style="width:100%"
                   type="text"
                   data-options="prompt:'@Html.DisplayNameFor(model => model.Title)',
								 required:true,
                                 validType: 'length[0,50]'
                                 " />
          </div>
          <label class="col-md-2 form-label text-right ">@Html.DisplayNameFor(model => model.Description)</label>
          <div class="col-md-4 mb-1">
            <input id="@Html.IdFor(model => model.Description)"
                   name="@Html.NameFor(model => model.Description)"
                   value="@Html.ValueFor(model => model.Description)"
                   tabindex="0" required
                   class="easyui-textbox"
                   style="width:100%"
                   type="text"
                   data-options="prompt:'@Html.DisplayNameFor(model => model.Description)',
								 required:false,validType: 'length[0,50]'
                                 " />
          </div>
          <label class="col-md-2 form-label text-danger text-right ">@Html.DisplayNameFor(model => model.Code)</label>
          <div class="col-md-4 mb-1">
            <input id="@Html.IdFor(model => model.Code)"
                   name="@Html.NameFor(model => model.Code)"
                   value="@Html.ValueFor(model => model.Code)"
                   tabindex="0" required
                   class="easyui-textbox"
                   style="width:100%"
                   type="text"
                   data-options="prompt:'@Html.DisplayNameFor(model => model.Code)',
								 required:true,validType: 'length[0,50]'
                                 " />
          </div>
          <label class="col-md-2 form-label text-danger text-right ">@Html.DisplayNameFor(model => model.Url)</label>
          <div class="col-md-4 mb-1">
            <input id="@Html.IdFor(model => model.Url)"
                   name="@Html.NameFor(model => model.Url)"
                   value="@Html.ValueFor(model => model.Url)"
                   tabindex="0" required
                   class="easyui-textbox"
                   style="width:100%"
                   type="text"
                   data-options="prompt:'@Html.DisplayNameFor(model => model.Url)',
								 required:true,validType: 'length[0,50]'
                                 " />
          </div>
          <label class="col-md-2 form-label text-danger text-right ">@Html.DisplayNameFor(model => model.Controller)</label>
          <div class="col-md-4 mb-1">
            <input id="@Html.IdFor(model => model.Controller)"
                   name="@Html.NameFor(model => model.Controller)"
                   value="@Html.ValueFor(model => model.Controller)"
                   tabindex="0" required
                   class="easyui-textbox"
                   style="width:100%"
                   type="text"
                   data-options="prompt:'@Html.DisplayNameFor(model => model.Controller)',
								 required:true,validType: 'length[0,50]'
                                 " />
          </div>
          <label class="col-md-2 form-label text-danger text-right ">@Html.DisplayNameFor(model => model.Action)</label>
          <div class="col-md-4 mb-1">
            <input id="@Html.IdFor(model => model.Action)"
                   name="@Html.NameFor(model => model.Action)"
                   value="@Html.ValueFor(model => model.Action)"
                   tabindex="0" required
                   class="easyui-textbox"
                   style="width:100%"
                   type="text"
                   data-options="prompt:'@Html.DisplayNameFor(model => model.Action)',
								 required:true,validType: 'length[0,50]'
                                 " />
          </div>
          <label class="col-md-2 form-label text-right ">@Html.DisplayNameFor(model => model.IconCls)</label>
          <div class="col-md-4 mb-1">
            <input id="@Html.IdFor(model => model.IconCls)"
                   name="@Html.NameFor(model => model.IconCls)"
                   value="@Html.ValueFor(model => model.IconCls)"
                   tabindex="0" required
                   class="easyui-textbox"
                   style="width:100%"
                   type="text"
                   data-options="prompt:'@Html.DisplayNameFor(model => model.IconCls)',
								 required:false,validType: 'length[0,50]'
                                 " />
          </div>
          <label class="col-md-2 form-label text-right ">@Html.DisplayNameFor(model => model.IsEnabled)</label>
          <div class="col-md-4 mb-1">
            <div class="custom-control custom-checkbox">
              <input type="checkbox" class="custom-control-input"
                     id="@Html.IdFor(model => model.IsEnabled)"
                     name="@Html.NameFor(model => model.IsEnabled)"
                     value="true" @(Model.IsEnabled ? "checked=\"checked\"" : "")>
              <label class="custom-control-label" for="@Html.IdFor(model => model.IconCls)">@Html.DescriptionFor(model => model.IsEnabled)</label>
            </div>

          </div>
          <label class="col-md-2 form-label text-right ">@Html.DisplayNameFor(model => model.ParentId)</label>
          <div class="col-md-4 mb-1">
              <input id="@Html.IdFor(model => model.ParentId)"
                     name="@Html.NameFor(model => model.ParentId)"
                     value="@Html.ValueFor(model => model.ParentId)"
                     tabindex="9"
                     style="width:100%"
                     class="easyui-combobox"
                     data-options="prompt:'@Html.DisplayNameFor(model => model.ParentId)' ,
						label:'' ,editable:false,
 						required:false ,
						valueField: 'Id',
						textField:  'Title' ,
						url: '/MenuItems/GetMenuItemsAsync' ,
						onSelect: function(item){
						//console.log(item);
				}">
          

          </div>
        </div>
      </fieldset>

    </form>
    <div id="cp-2" class="card border">
      <div class="card-header p-0">
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
          <a class="navbar-brand" href="#">子菜单</a>
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
              <li class="nav-item ">
                <a class="nav-link" href="javascript:menuitems_append()">新增 <span class="sr-only">(current)</span></a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="javascript:menuitems_removeit()">删除 <span class="sr-only">(current)</span></a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="javascript:menuitems_accept()">保存 <span class="sr-only">(current)</span></a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="javascript:menuitems_reject()">取消 <span class="sr-only">(current)</span></a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="javascript:menuitems_reload()">刷新 <span class="sr-only">(current)</span></a>
              </li>
            </ul>
          
          </div>
        </nav>
      </div>
      <div class="card-body ">
        <div class="table-responsive">
          <table id="childmenuitems_datagrid"></table>

        </div>
      </div>
      <div class="card-footer  py-2">
        
      </div>
    </div>
  </div>
  </div>
  <!-- end toolbar -->
  <!-- begin window body -->
  
  <!--end window body -->
</div>
<div id="windowfooter" style="padding:5px;">&nbsp;</div>
<!-- 弹出窗体form表单 -->

<script type="text/javascript">

</script>

